<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title>${"${channel.channelTitle!}-政府采购信息网"}</title>
    <meta name="description" content="${channel.channelDescriptions}">
    <meta name="keywords" content="${channel.channelKeyword}">
    <link rel="icon" href="/web/img/favicon.ico">
    <link rel="shortcut icon" href="/web/img/favicon.ico">
    <!--    <link rel="stylesheet" href="//at.alicdn.com/t/font_2052942_xzk2q3ix0w.css">-->
    <link rel="stylesheet/less" href="/web/css/tag-list.less">
    <script src="/web/lib/less.min.js"></script>
    <script src="/web/lib/jquery-1.12.4.min.js"></script>
    <script src="/web/public/public.js"></script>
    <script src="/web/lib/jquery.pagination.js"></script>
</head>
<body>
<div class="container">
    <!--这里引入header-->
    <!--#include virtual="/web/html/header/header.htm"-->
    <div id="main">
        <div class="left">
            <h2 class="position">
                <a href="${domain}" target="_blank">首页</a><span></span>
            </h2>
            <ul class="content-list"></ul>
            <div class="list-pagination"></div>
        </div>
        <div class="right">
            <!--视频课堂-->
            <!--#include virtual="/web/html/fragment/public/video-classroom.htm"-->
            <!--亚利聊政采-->
            <!--#include virtual="/web/html/fragment/public/audio-column.htm"-->
            <!--热点专题-->
            <!--#include virtual="/web/html/fragment/home/right-boutique.htm"-->
            <!--热搜榜-->
            <!--#include virtual="/web/html/fragment/home/right-hot-search.htm"-->
            <!-- 广告位(马老师不确定)-->
            <!--#include virtual="/web/html/fragment/home/ad-list-one.htm"-->
            <!--#include virtual="/web/html/fragment/home/ad-list-two.htm"-->
        </div>
    </div>
    <!--#include virtual="/web/html/footer/footer.htm"-->
</div>
<script>
    var tagId = utils.getQueryVariable('id');
    function getTagList(pageNum,resetPage){
        var pageSize = 12;
        $.ajax({
            url: ports.author_post_list,
            data: {
                articlePromoterId: tagId,
                pageNum:pageNum,
                pageSize:pageSize
            },
            success:function(res) {
                console.log('获取标签列表11',res);
                var tagListHtml = '';
                var tagList = res.data.list;
                tagList.forEach(function (item) {
                    var keywordsListHtml = '';
                    item.articleKeywordList.forEach(function (item1) {
                        keywordsListHtml += '<a href='+ '/web/tagList/1.html?tag='+item1.keyword+' class="tag">'+ item1.keyword +'</a>'
                    })
                    tagListHtml += '<li>\n' +
                        (item.articleImage ?'<div class="left"><a target="_blank" href="'+ (item.articleOutLinkStatus==0?item.articleUrl:item.articleOutLink) +'"><img src='+ item.articleImage + ' title='+ item.articleTitle +' alt='+ item.articleTitle +'></a></div>':'')
                        +
                        '                    <div class="right">\n' +
                        '                        <div class="title"><a target="_blank" href="'+ (item.articleOutLinkStatus==0?item.articleUrl:item.articleOutLink) +'">'+ item.articleTitle +'</a></div>\n' +
                        '                        <p></p>' +
                        '                        <div class="info">\n' +
                        '                            <i class="iconfont icon-shijian"></i><span>'+ item.publicTime.substr(0,10) +'</span>\n' +
                        '\n'
                        + keywordsListHtml +
                        '                        </div>\n' +
                        '                    </div>\n' +
                        '                </li>'                })
                $('ul.content-list').html(tagListHtml);
                if(resetPage){
                    $('.list-pagination').pagination({
                        prevContent: '< 上一页',
                        nextContent: '下一页 >',
                        totalData: res.data.total,
                        showData: pageSize,
                        coping: true,
                        callback: function (api) {
                            console.log(api.getCurrent());
                            var current = api.getCurrent();
                            document.body.scrollTop = 0;
                            document.documentElement.scrollTop = 0;
                            getTagList(current,false);
                        }
                    });
                }

            }
        });
    }

    getTagList(1,true);

</script>
</body>
</html>
